package kr.co.m2soft.draw
{
	import flash.display.Shape;
	
	import kr.co.m2soft.model.CommonModel;
	import kr.co.m2soft.model.page.elements.IFigure;
	import kr.co.m2soft.model.page.elements.IPGElement;
	
	import spark.components.Group;
	
	public class BaseDraw extends Group implements IBaseDraw
	{
		public static const LINE_SOLID:int = 0;
		public static const LINE_DASH:int = 1;
		public static const LINE_DOT:int = 2;
		public static const LINE_DASH_DOT:int = 3;
		public static const LINE_DASH_DOT_DOT:int = 4;
		
		private var _model:IFigure;
		private var _target:Object;
		private var _shape:Shape;
		public var commonModel:CommonModel = CommonModel.getInstance();
		public function BaseDraw()
		{
			super();
		}
		
		public function draw():void
		{
			
		}
		//라인스타일 얻어오
		public function getLineStyle(lineStyle:int,strokeWeight:Number):Array
		{
			var dashArray:Array = [];
			strokeWeight = isNaN(strokeWeight) ? 1 : strokeWeight;
			switch(lineStyle)
			{
				case LINE_SOLID :
					dashArray = [1,0];
					break;
				case LINE_DASH :
					dashArray = [4*strokeWeight,4*strokeWeight];
					break;
				case LINE_DOT :
					dashArray = [2*strokeWeight,4*strokeWeight];
					break;
				case LINE_DASH_DOT :
					dashArray = [4*strokeWeight,4*strokeWeight,2*strokeWeight,4*strokeWeight];
					break;
				case LINE_DASH_DOT_DOT : 
					dashArray = [4*strokeWeight,4*strokeWeight,2*strokeWeight,4*strokeWeight,2*strokeWeight,4*strokeWeight];
					break;
			}
			return dashArray;
		}
		public function get model():IFigure
		{
			return _model;
		}

		public function set model(value:IFigure):void
		{
			_model = value;
		}

		public function get target():Object
		{
			return _target;
		}

		public function set target(value:Object):void
		{
			_target = value;
		}

		public function get shape():Shape
		{
			return _shape;
		}

		public function set shape(value:Shape):void
		{
			_shape = value;
		}

		
	}
}